<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的订单</title>
    <!-- 引入Bootstrap -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <h1 class="mt-4">我的订单</h1>

    <div class="btn-group mb-4" role="group">
        <a href="${pageContext.request.contextPath}/dogwalking/orders?status=0"
           class="btn ${status == 0 ? 'btn-primary' : 'btn-secondary'}">待支付</a>
        <a href="${pageContext.request.contextPath}/dogwalking/orders?status=1"
           class="btn ${status == 1 ? 'btn-primary' : 'btn-secondary'}">已支付</a>
        <a href="${pageContext.request.contextPath}/dogwalking/orders?status=2"
           class="btn ${status == 2 ? 'btn-primary' : 'btn-secondary'}">进行中</a>
        <a href="${pageContext.request.contextPath}/dogwalking/orders?status=3"
           class="btn ${status == 3 ? 'btn-primary' : 'btn-secondary'}">已完成</a>
        <a href="${pageContext.request.contextPath}/dogwalking/orders?status=4"
           class="btn ${status == 4 ? 'btn-primary' : 'btn-secondary'}">已取消</a>
        <a href="${pageContext.request.contextPath}/dogwalking/orders?status=0"
           class="btn ${status == null ? 'btn-primary' : 'btn-secondary'}">全部</a>
    </div>

    <c:if test="${not empty error}">
    <div class="alert alert-danger" role="alert">
            ${error}
    </div>
    </c:if>

    <c:if test="${not empty message}">
    <div class="alert alert-success" role="alert">
            ${message}
    </div>
    </c:if>

    <c:if test="${empty orders}">
    <div class="alert alert-info" role="alert">
        暂无订单记录
    </div>
    </c:if>

    <table class="table table-striped">
        <thead>
        <tr>
            <th>订单号</th>
            <th>服务名称</th>
            <th>价格</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
    </table>